package cate.game.pvp.guildwar.data;


import cate.game.role.res.guild.po.GuildPO;
import cate.game.role.res.guild.po.basic.GuildBanner;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("公会战公会简要信息")
public class GWGuildProfile {

    @NoteField("当前区服ID")
    public int srvId;

    @NoteField("公会唯一id")
    public String uid;

    @NoteField("公会名称")
    public String name;

    @NoteField("公会等级")
    public int level;

    @NoteField("总战力")
    public long totalPower;

    @NoteField("旗帜")
    public GuildBanner guildBanner;

    @NoteField("本轮开始前的积分")
    public int point;

    public static GWGuildProfile of(int srvId,GuildPO guild){
        GWGuildProfile profile = new GWGuildProfile();
        profile.srvId = srvId;
        profile.uid = guild.uid;
        profile.name = guild.basic.guildName;
        profile.level = guild.basic.level;
        profile.totalPower = guild.basic.power;
        profile.guildBanner = guild.basic.guildBanner;
        profile.point = guild.war.point;
        return profile;
    }

    public GWGuildProfile copy() {
        GWGuildProfile cp = new GWGuildProfile();
        cp.srvId = this.srvId;
        cp.uid = this.uid;
        cp.name = this.name;
        cp.level = this.level;
        cp.totalPower = this.totalPower;
        cp.guildBanner = this.guildBanner != null ? this.guildBanner.copy() : null;
        cp.point = this.point;
        return cp;
    }

    public void clear(){
        srvId = 0;
        uid = null;
        name = null;
        level = 0;
        totalPower = 0;
        guildBanner = null;
        point = 0;
    }
}
